#!/bin/sh

echo 'Please enter your svn login (or empty for read-only profile):'
read login
if [ -z $login ]
then
    svn checkout http://ynot.googlecode.com/svn/ynot/trunk/ ynot
    svn checkout http://ynot.googlecode.com/svn/ynot-core/trunk/ ynot-core
    svn checkout http://ynot.googlecode.com/svn/ynot-lang/trunk/ ynot-lang
    svn checkout http://ynot.googlecode.com/svn/ynot-vm/trunk/ ynot-vm
else
    echo 'Please enter your svn password:'
    read password
    svn checkout https://ynot.googlecode.com/svn/ynot/trunk/ ynot --username "$login" --password "$password"
    svn checkout https://ynot.googlecode.com/svn/ynot-core/trunk/ ynot-core --username "$login" --password "$password"
    svn checkout https://ynot.googlecode.com/svn/ynot-lang/trunk/ ynot-lang --username "$login" --password "$password"
    svn checkout https://ynot.googlecode.com/svn/ynot-vm/trunk/ ynot-vm --username "$login" --password "$password"
fi

mvn clean eclipse:clean eclipse:eclipse -f ynot-core/pom.xml
mvn clean eclipse:clean eclipse:eclipse -f ynot-lang/pom.xml
mvn clean eclipse:clean eclipse:eclipse -f ynot-vm/pom.xml
